<?php
/**
 * @package YARBB
 * @copyright Авторские права (C) 2009 www.yar-it.com. Все права защищены.
 * @license Лицензия http://www.gnu.org/licenses/gpl-2.0.htm GNU/GPL, или help/license.php
 * YARBB! - свободное программное обеспечение распространяемое по условиям лицензии GNU/GPL
 * Для получения информации о используемых расширениях и замечаний об авторском праве, смотрите файл copyright.php.
 */

// no direct access
defined('_VALID_MOS')or die('Прямой доступ запрещен.');

?>
<table class="adminheading">
	<tbody>
		<tr>
			<th class="config"><?php echo _Y_OPTIONS; ?></th>
		</tr>
	</tbody>
</table>
<form action="<?php echo 'index2.php?option=com_forum&amp;task=options'; ?>" method="post" name="adminForm" id="adminForm" >
	<input type="hidden" name="task" value="options" />
	<input type="hidden" name="act" value="update_config" />
	<?php
	$tabs = new mosTabs(1, 1);
	$tabs->startPane("configPane");
	$tabs->startTab(_Y_MAIN_CONFIG, "Essentials");
	?>
	<table width="100%" class="adminform" >
		<tr>
			<td width="20%"><?php echo _Y_HEADER_TITLE; ?></td>
			<td colspan="2"><input type="text" name="form[board_title]" size="50" maxlength="255" value="<?php echo yarbb_htmlspecialchars($yarbb_config['o_board_title']) ?>" />
				&nbsp;<?php echo mosToolTip(  _Y_BULL_HEADER); ?>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_CMN_DESCRIPTION; ?></td>
			<td><input type="text" name="form[board_desc]" size="50" maxlength="255" value="<?php echo yarbb_htmlspecialchars($yarbb_config['o_board_desc']) ?>" />
				&nbsp;<?php echo mosToolTip( _Y_DESCR_FORUM) ?>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_CONDITION; ?></td>
			<td colspan="2"><input type="text" name="form[board_redirect]" size="50" maxlength="255" value="<?php echo $yarbb_config['o_board_redirect'] ?>" />
				&nbsp;<?php echo mosToolTip(  _Y_CONDITION_DESC); ?>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_CONDITION_URL; ?></td>
			<td colspan="2"> <textarea type="text" name="form[board_redirect_url]" rows="3" cols="40" >
        &nbsp;<?php echo yarbb_htmlspecialchars($yarbb_config['o_board_redirect_url']) ?> </textarea><?php echo mosToolTip(  _Y_CONDITION_URL_D); ?>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_STYLE_DEF; ?></td>
			<td colspan="2">

				<?php

				$theme = array ();

				if (file_exists (JPATH_BASE.'/components/com_forum/theme')) {
					$d = dir (JPATH_BASE.'/components/com_forum/theme');
					while (false !== ($entry = $d->read ()))
						if ($entry != '.' && $entry != '..')
							$theme[] = $entry;
					$d->close ();
				}

				if (!empty ($theme)) {
					?>
				<select name="form[default_style]">
						<?php
						foreach ($theme as $rt_theme) {
							?>
					<option value="<?php echo $rt_theme; ?>" <?php if ($yarbb_config['o_default_style'] == $rt_theme) echo ' selected="selected"' ?> > <?php echo $rt_theme; ?></option>
							<?php
						}
					}
					?>
				</select>
				&nbsp;<?php echo mosToolTip( _Y_STYLE_DESC); ?>
			</td>
		</tr>
		<tr>
			<td><a name="maintenance"><?php echo _Y_FORUMCLOUSE; ?></a></td>
			<td colspan="2"><input type="radio" name="form[maintenance]" value="1"<?php if ($yarbb_config['o_maintenance'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[maintenance]" value="0"<?php if ($yarbb_config['o_maintenance'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span><?php echo mosToolTip(_Y_FORUMCLOUSE_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_FORUMCLOUSEMES; ?></td>
			<td><textarea name="form[maintenance_message]" rows="5" cols="55"><?php echo yarbb_htmlspecialchars($yarbb_config['o_maintenance_message']) ?></textarea>
				<span> <?php echo mosToolTip(_Y_ANONCE_MESS_D); ?></span>&nbsp;
			</td>
		</tr>
	</table>
	<?php
	$tabs->endTab();
	$tabs->startTab(_Y_TIME_STAT, "time_time");

	?>
	<table width="100%" class="adminform">
		<tr>
			<td width="20%"><?php echo _Y_TIME_FORM; ?></td>
			<td><input type="text" name="form[time_format]" size="25" maxlength="25" value="<?php echo yarbb_htmlspecialchars($yarbb_config['o_time_format']) ?>" />
				<span>[<?php echo _Y_TIME_CURR; ?> <?php echo date($yarbb_config['o_time_format']) ?>]<?php echo _Y_TIME_FORM_D; ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _DATE_FORMAT; ?></td>
			<td><input type="text" name="form[date_format]" size="25" maxlength="25" value="<?php echo yarbb_htmlspecialchars($yarbb_config['o_date_format']) ?>" />
				<span>[<?php echo _Y_TIME_CURR; ?> <?php echo date($yarbb_config['o_date_format']) ?>]<?php echo _Y_TIME_FORM_D; ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_TIMEOUT_VIZ; ?></td>
			<td><input type="text" name="form[timeout_visit]" size="5" maxlength="5" value="<?php echo $yarbb_config['o_timeout_visit'] ?>" />
				<span><?php echo mosToolTip( _Y_TIMEOUT_VIZ_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_TIMEOUT_ONLIN; ?></td>
			<td><input type="text" name="form[timeout_online]" size="5" maxlength="5" value="<?php echo $yarbb_config['o_timeout_online'] ?>" />
				<span><?php echo mosToolTip( _Y_TIMEOUT_ONLIN_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_REDIREKTTIME; ?></td>
			<td><input type="text" name="form[redirect_delay]" size="3" maxlength="3" value="<?php echo $yarbb_config['o_redirect_delay'] ?>" />
				<span><?php echo mosToolTip( _Y_REDIREKTTIME_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_TIME_GLUE; ?></td>
			<td><input type="text" name="form[merge_timeout]" size="5" maxlength="5" value="<?php echo $yarbb_config['o_merge_timeout'] ?>" />
				<span><?php echo mosToolTip( _Y_TIME_GLUE_D); ?></span>
			</td>
		</tr>
	</table>
	<?php
	$tabs->endTab();
	$tabs->startTab(_Y_DISPLAY, "Display");

	?>
	<table width="100%"  class="adminform">
		<tr>
			<td width="20%"><?php echo _Y_VERSION; ?></td>
			<td><input type="radio" name="form[show_version]" value="1"<?php if ($yarbb_config['o_show_version'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[show_version]" value="0"<?php if ($yarbb_config['o_show_version'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip( _Y_VERSION_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_INFO_USER; ?></td>
			<td><input type="radio" name="form[show_user_info]" value="1"<?php if ($yarbb_config['o_show_user_info'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[show_user_info]" value="0"<?php if ($yarbb_config['o_show_user_info'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip( _Y_INFO_USER_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_POSTS_USER; ?></td>
			<td><input type="radio" name="form[show_post_count]" value="1"<?php if ($yarbb_config['o_show_post_count'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[show_post_count]" value="0"<?php if ($yarbb_config['o_show_post_count'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip( _Y_POSTS_USER_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_SMILES; ?></td>
			<td><input type="radio" name="form[smilies]" value="1"<?php if ($yarbb_config['o_smilies'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[smilies]" value="0"<?php if ($yarbb_config['o_smilies'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip( _Y_SMILES_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_SMILESIN_SIG; ?></td>
			<td><input type="radio" name="form[smilies_sig]" value="1"<?php if ($yarbb_config['o_smilies_sig'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[smilies_sig]" value="0"<?php if ($yarbb_config['o_smilies_sig'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip( _Y_SMILES_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_AKTIV_LINK; ?></td>
			<td><input type="radio" name="form[make_links]" value="1"<?php if ($yarbb_config['o_make_links'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[make_links]" value="0"<?php if ($yarbb_config['o_make_links'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip( _Y_AKTIV_LINK_D); ?></span>
			</td>
		</tr>
		<tr>
			<td width="20%"><?php echo _Y_ENAB_AVATARS; ?></td>
			<td><input type="radio" name="form[avatars]" value="1"<?php if ($yarbb_config['o_avatars'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[avatars]" value="0"<?php if ($yarbb_config['o_avatars'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span><?php echo mosToolTip(_Y_ENAB_AVATARS_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_POST_PAGE; ?></td>
			<td><input type="text" name="form[topic_review]" size="3" maxlength="3" value="<?php echo $yarbb_config['o_topic_review'] ?>" />
				<span>&nbsp;<?php echo mosToolTip( _Y_POST_PAGE_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_TOPIC_PAGE; ?></td>
			<td><input type="text" name="form[disp_topics_default]" size="3" maxlength="3" value="<?php echo $yarbb_config['o_disp_topics_default'] ?>" />
				<span>&nbsp;<?php echo mosToolTip( _Y_TOPIC_PAGE_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_POSTPAGE; ?></td>
			<td><input type="text" name="form[disp_posts_default]" size="3" maxlength="3" value="<?php echo $yarbb_config['o_disp_posts_default'] ?>" />
				<span>&nbsp;<?php echo mosToolTip( _Y_POSTPAGE_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_INDENTSIZE; ?></td>
			<td><input type="text" name="form[indent_num_spaces]" size="3" maxlength="3" value="<?php echo $yarbb_config['o_indent_num_spaces'] ?>" />
				<span>&nbsp;<?php echo mosToolTip( _Y_INDENTSIZ_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_RSS; ?></td>
			<td><input type="text" name="form[rss_message_char]" size="3" maxlength="3" value="<?php echo $yarbb_config['o_rss_message_char'] ?>" />
				<span>&nbsp;<?php echo mosToolTip( _Y_RSS_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_NEWWIN_LINK; ?></td>
			<td><input type="radio" name="form[new_window_link]" value="1"<?php if ($yarbb_config['o_new_window_link'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[new_window_link]" value="0"<?php if ($yarbb_config['o_new_window_link'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip( _Y_NEWWIN_LINK_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_MOSTAKTIV_US; ?></td>
			<td><input type="radio" name="form[top_ten]" value="1"<?php if ($yarbb_config['o_top_ten'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[top_ten]" value="0"<?php if ($yarbb_config['o_top_ten'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip( _Y_MOSTAKTIV_US_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_MOSTAKTIV_KOL; ?></td>
			<td><input type="text" name="form[top_post_count]" size="3" maxlength="3" value="<?php echo $yarbb_config['o_top_post_count'] ?>" />
				<span>&nbsp;<?php echo mosToolTip( _Y_MOSTAKTIV_KOL_D); ?></span>
			</td>
		</tr>
	</table>
	<?php
	$tabs->endTab();
	$tabs->startTab(_Y_SVOISTVA, "Features");
	?>
	<table width="100%" class="adminform">
		<tr>
			<td width="20%"><?php echo _Y_QUICK_POST; ?></td>
			<td colspan="2"><input type="radio" name="form[quickpost]" value="1"<?php if ($yarbb_config['o_quickpost'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[quickpost]" value="0"<?php if ($yarbb_config['o_quickpost'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip(_Y_QUICK_POST_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_USERS_ON_LINES; ?></td>
			<td colspan="2"><input type="radio" name="form[users_online]" value="1"<?php if ($yarbb_config['o_users_online'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[users_online]" value="0"<?php if ($yarbb_config['o_users_online'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip(_Y_USERS_ON_LINES_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_CENSOR; ?></td>
			<td colspan="2"><input type="radio" name="form[censoring]" value="1"<?php if ($yarbb_config['o_censoring'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[censoring]" value="0"<?php if ($yarbb_config['o_censoring'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip(_Y_CENSOR_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_RANGS; ?></td>
			<td colspan="2"><input type="radio" name="form[ranks]" value="1"<?php if ($yarbb_config['o_ranks'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[ranks]" value="0"<?php if ($yarbb_config['o_ranks'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip(_Y_RANGS_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_USERS_HAS; ?></td>
			<td colspan="2"><input type="radio" name="form[show_dot]" value="1"<?php if ($yarbb_config['o_show_dot'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[show_dot]" value="0"<?php if ($yarbb_config['o_show_dot'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip(_Y_USERS_HAS_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_QUICK_JAMP; ?></td>
			<td colspan="2"><input type="radio" name="form[quickjump]" value="1"<?php if ($yarbb_config['o_quickjump'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[quickjump]" value="0"<?php if ($yarbb_config['o_quickjump'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip(_Y_QUICK_JAMP_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _ENABLE_GZIP; ?></td>
			<td colspan="2"><input type="radio" name="form[gzip]" value="1"<?php if ($yarbb_config['o_gzip'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[gzip]" value="0"<?php if ($yarbb_config['o_gzip'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip(_ENABLE_GZIP2); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_SEARCH_TITLE; ?></td>
			<td colspan="2"><input type="radio" name="form[search_all_forums]" value="1"<?php if ($yarbb_config['o_search_all_forums'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[search_all_forums]" value="0"<?php if ($yarbb_config['o_search_all_forums'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip(_Y_SEARCH_ALL); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_CAPTCHA_GUESTS; ?></td>
			<td><input type="radio" name="form[guest_post_captchabox]" value="1"

					   <?php if ($yarbb_config['o_guest_post_captchabox'] == '1') echo ' checked="checked"' ?>  tabindex="1"/>
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[guest_post_captchabox]" value="0"

					   <?php if ($yarbb_config['o_guest_post_captchabox'] == '0') echo 'checked="checked"' ?>  tabindex="2"/>
				&nbsp;<strong><?php echo _NO; ?></strong> &nbsp;<?php echo mosToolTip(_Y_CAPTCHA_GUESTS_D); ?>
			</td>
		</tr>
		<?php /*  //***Временное решение до восстановления опросов***
		<tr>
			<td><?php echo _Y_POLLS_COLS; ?></td>
			<td><input type="text" name="form[poll_max_fields]" size="4" value="<?php echo $yarbb_config['o_poll_max_fields'] ?>" tabindex="1" />
				&nbsp;<span><?php echo mosToolTip(_Y_POLLS_COLS_D); ?></span> </td>
		</tr>
		*/ ?>
		<tr>
			<td><?php echo _Y_DOP_MENU; ?></td>
			<td><textarea name="form[additional_navlinks]" rows="3" cols="55"><?php echo yarbb_htmlspecialchars($yarbb_config['o_additional_navlinks']) ?></textarea>
				<span>&nbsp;<?php echo mosToolTip(_Y_DOP_MENU_D); ?></span>&nbsp;</td>
		</tr>
		<tr>
			<td><?php echo _Y_USE_RULE; ?></td>
			<td colspan="2"><input type="radio" name="form[rules]" value="1"<?php if ($yarbb_config['o_rules'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[rules]" value="0"<?php if ($yarbb_config['o_rules'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span>&nbsp;<?php echo mosToolTip(_Y_USE_RULE_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_RULES; ?></td>
			<td><textarea name="form[rules_message]" rows="10"  cols="60"><?php echo yarbb_htmlspecialchars($yarbb_config['o_rules_message']) ?></textarea>
				<span>&nbsp;<?php echo mosToolTip(_Y_RULES_D); ?></span>
			</td>
		</tr>
	</table>
	<?php
	$tabs->endTab();
	$tabs->startTab(_MAIL, "Email");

	?>
	<table width="100%" class="adminform">
		<tr>
			<td width="20%"><?php echo _Y_EMAIL_ADM; ?></td>
			<td><input type="text" name="form[admin_email]" size="50" maxlength="50" value="<?php echo $yarbb_config['o_admin_email'] ?>" />
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_EMAIL_WEBM; ?></td>
			<td><input type="text" name="form[webmaster_email]" size="50" maxlength="50" value="<?php echo $yarbb_config['o_webmaster_email'] ?>" />
				<span> <?php echo mosToolTip(_Y_EMAIL_WEBM_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_SUBS_REP; ?></td>
			<td><input type="radio" name="form[subscriptions]" value="1"<?php if ($yarbb_config['o_subscriptions'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[subscriptions]" value="0"<?php if ($yarbb_config['o_subscriptions'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span><?php echo mosToolTip(_Y_SUBS_REP_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _SMTP_SERVER; ?></td>
			<td><input type="text" name="form[smtp_host]" size="30" maxlength="100" value="<?php echo yarbb_htmlspecialchars($yarbb_config['o_smtp_host']) ?>" />
				<span><?php echo mosToolTip(_Y_SMTP_USE); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _SMTP_USER; ?></td>
			<td><input type="text" name="form[smtp_user]" size="25" maxlength="50" value="<?php echo yarbb_htmlspecialchars($yarbb_config['o_smtp_user']) ?>" />
				<span><?php echo mosToolTip(_SMTP_USER2); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _SMTP_PASS; ?></td>
			<td><input type="text" name="form[smtp_pass]" size="25" maxlength="50" value="<?php echo yarbb_htmlspecialchars($yarbb_config['o_smtp_pass']) ?>" />
				<span><?php echo mosToolTip(_SMTP_PASS2); ?></span>
			</td>
		</tr>
	</table>
	<?php
	$tabs->endTab();
	$tabs->startTab(_Y_GLOB_ANONC, "Announc");

	?>
	<table width="100%" class="adminform">
		<tr>
			<td><?php echo _Y_ANONCE_USE; ?></td>
			<td><input type="radio" name="form[announcement]" value="1"<?php if ($yarbb_config['o_announcement'] == '1') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _YES; ?></strong>&nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[announcement]" value="0"<?php if ($yarbb_config['o_announcement'] == '0') echo ' checked="checked"' ?> />
				&nbsp;<strong><?php echo _NO; ?></strong> <span><?php echo mosToolTip(_Y_ANONCE_USE_D); ?></span>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_ANONCE_MESS; ?></td>
			<td><textarea name="form[announcement_message]" rows="5" cols="55"><?php echo yarbb_htmlspecialchars($yarbb_config['o_announcement_message']) ?></textarea>
				<span><?php echo mosToolTip(_Y_ANONCE_MESS_D); ?></span>
			</td>
		</tr>
	</table>
	<?php
	$tabs->endTab();
	$tabs->startTab(_Y_INTEGRATIONS, "Integration");

	?>
	<table class="adminform" width="100%">
		<tr>
			<td width="20%"><?php echo _Y_INTEGUDDEIM; ?></td>
			<td colspan="2"><input type="radio" name="form[pms_uddeim]" value="1"<?php if ($yarbb_config['o_pms_uddeim'] == '1') echo ' checked="checked"' ?> />
				&nbsp; <strong><?php echo _YES; ?></strong> &nbsp;&nbsp;&nbsp;
				<input type="radio" name="form[pms_uddeim]" value="0"<?php if ($yarbb_config['o_pms_uddeim'] == '0') echo ' checked="checked"' ?> />
				&nbsp; <strong><?php echo _NO; ?></strong> <span><?php echo mosToolTip(_Y_INTEGUDDEIM_D); ?></span>
			</td>
		</tr>
		</tr>

	</table>
	<?php
	$tabs->endTab();
	$tabs->startTab(_Y_UPLOAD, "Upload");
	?>
	<table class="adminform" >
		<tr>
			<td width="20%"><?php echo _Y_UPLPERMEX; ?></td>
			<td><input type="text" name="form[uploadile_laws]" id="laws" size="80" tabindex="<?php echo $tabindex++; ?>" value="<?php echo @$yarbb_config['o_uploadile_laws'] ?>" />
				<?php echo mosToolTip(_Y_UPLPERMEX_D); ?>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_UPLTHMB; ?></td>
			<td><input type="radio" name="form[uploadile_thumb]" value="1"<?php if (@$yarbb_config['o_uploadile_thumb'] == '1') echo ' checked="checked"' ?> />
				<strong><?php echo _YES; ?></strong>&nbsp;
				<input type="radio" name="form[uploadile_thumb]" value="0"<?php if (@$yarbb_config['o_uploadile_thumb'] == '0') echo ' checked="checked"' ?> />
				<strong><?php echo _NO; ?></strong>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_UPLTHMBSIZ; ?></td>
			<td><input type="text" name="form[uploadile_thumb_size]"  id="thumb_size" size="4" tabindex="<?php echo $tabindex++; ?>" value="<?php echo @$yarbb_config['o_uploadile_thumb_size'] ?>" />px
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_UPLMEMB; ?></td>
			<td><input type="text" name="form[uploadile_maxsize_member]" id="maxsize_member" size="15" tabindex="<?php echo $tabindex++; ?>" value="<?php echo @$yarbb_config['o_uploadile_maxsize_member'] ?>" />
				<?php echo _Y_UPLBYT; ?>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_UPLMEM2; ?></td>
			<td><input type="text" name="form[uploadile_limit_member]" id="limit_member" size="15" tabindex="<?php echo $tabindex++; ?>" value="<?php echo @$yarbb_config['o_uploadile_limit_member'] ?>" />
				<?php echo _Y_UPLBYT; ?>
			</td>
		</tr>
		<tr>
			<td><?php echo _Y_UPLMODER; ?></td>
			<td><input type="text" name="form[uploadile_maxsize_modo]" id="maxsize_modo" size="15" tabindex="<?php echo $tabindex++; ?>" value="<?php echo @$yarbb_config['o_uploadile_maxsize_modo'] ?>" />
				<?php echo _Y_UPLBYT; ?></td>
		</tr>
		<tr>
			<td><?php echo _Y_UPLMODER; ?></td>
			<td><input type="text" name="form[uploadile_limit_modo]" id="limit_modo" size="15" tabindex="<?php echo $tabindex++; ?>" value="<?php echo @$yarbb_config['o_uploadile_limit_modo'] ?>" />
				<?php echo _Y_UPLBYT; ?>
			</td>
		</tr>
	</table>
	<table class="adminform" >
		<tr>
			<th><?php echo _Y_UPLHELP; ?></th>
		</tr>
		<tr>
			<td><?php echo _Y_UPLBYT_M; ?>
				<input type="text" name="mo" id="mo" size="15" tabindex="<?php echo $tabindex++; ?>" />
				<input type="button" value="<?php echo _Y_UPLCONV; ?>" tabindex="<?php echo $tabindex++; ?>" onclick="javascript:document.getElementById('ko').value=document.getElementById('mo').value*1024; document.getElementById('o').value=document.getElementById('mo').value*1048576;" />
				<?php echo _Y_UPLBYT_K; ?>
				<input type="text" name="ko" id="ko" size="15" tabindex="<?php echo $tabindex++; ?>" />
				<input type="button" value="<?php echo _Y_UPLCONV; ?>" tabindex="<?php echo $tabindex++; ?>" onclick="javascript:document.getElementById('mo').value=document.getElementById('ko').value/1024; document.getElementById('o').value=document.getElementById('ko').value*1048576;"/>
				<?php echo _Y_UPLBYT; ?>
				<input type="text" name="o" id="o" size="15" tabindex="<?php echo $tabindex++; ?>" />
				<input type="button" value="<?php echo _Y_UPLCONV; ?>" tabindex="<?php echo $tabindex++; ?>" onclick="javascript:document.getElementById('mo').value=document.getElementById('o').value/1048576; document.getElementById('ko').value=(document.getElementById('o').value*1024)/1048576;"/>
				<p><?php echo _Y_UPLNOTE; ?> : 1 Mb = 1 024 Kb = 1 048 576 b</p>
			</td>
		</tr>
	</table>
	<?php
	$tabs->endTab();
	?>
</form>
<?php

// сохраняем конфигурацию
$act = strval(mosGetParam($_POST, 'act', null));
if ($act == 'update_config') {
	$allow = array_map('trim', $_POST['allow']);
	$form = array_map('trim', $_POST['form']);
	if ($form['board_title'] == '') {
		mosRedirect('index2.php?option=com_forum&amp;task=options', _Y_NO_TITLE);
	}
	require 'components/com_forum/include/email.php';
	$form['admin_email'] = strtolower($form['admin_email']);
	if (!is_valid_email($form['admin_email'])) {
		mosRedirect('index2.php?option=com_forum&amp;task=options', _Y_NO_ADMEMAIL);
	}
	$form['webmaster_email'] = strtolower($form['webmaster_email']);
	if (!is_valid_email($form['webmaster_email'])) {
		mosRedirect('index2.php?option=com_forum&amp;task=options', _Y_NO_WEBEMAL);
	}
	// Clean avatars_dir
	$form['avatars_dir'] = str_replace("\0", '', $form['avatars_dir']);
	// Make sure avatars_dir doesn't end with a slash
	if (substr($form['avatars_dir'], -1) == '/') {
		$form['avatars_dir'] = substr($form['avatars_dir'], 0, -1);
	}
	if ($form['additional_navlinks'] != '') {
		$form['additional_navlinks'] = trim(yarbb_linebreaks($form['additional_navlinks']));
	}
	if ($form['announcement_message'] != '') {
		$form['announcement_message'] = yarbb_linebreaks($form['announcement_message']);
	} else {
		$form['announcement_message'] = 'Enter your announcement here.';
		if ($form['announcement'] == '1') {
			$form['announcement'] = '0';
		}
	}
	if ($form['rules_message'] != '') {
		$form['rules_message'] = yarbb_linebreaks($form['rules_message']);
	} else {
		$form['rules_message'] = 'Enter your rules here.';
		if ($form['rules'] == '1') {
			$form['rules'] = '0';
		}
	}
	if ($form['maintenance_message'] != '') {
		$form['maintenance_message'] = yarbb_linebreaks($form['maintenance_message']);
	} else {
		$form['maintenance_message'] = 'The forums are temporarily down for maintenance. Please try again in a few minutes.\n\n/Administrator';
		if ($form['maintenance'] == '1') {
			$form['maintenance'] = '0';
		}
	}
	$form['timeout_visit'] = intval($form['timeout_visit']);
	$form['timeout_online'] = intval($form['timeout_online']);
	$form['redirect_delay'] = intval($form['redirect_delay']);
	$form['topic_review'] = intval($form['topic_review']);
	$form['disp_topics_default'] = intval($form['disp_topics_default']);
	$form['disp_posts_default'] = intval($form['disp_posts_default']);
	$form['indent_num_spaces'] = intval($form['indent_num_spaces']);
	$form['avatars_width'] = intval($form['avatars_width']);
	$form['avatars_height'] = intval($form['avatars_height']);
	$form['avatars_size'] = intval($form['avatars_size']);
	$form['guest_post_captchabox'] = intval($form['guest_post_captchabox']);
	$form['poll_max_fields'] = intval($form['poll_max_fields']);

	if ($form['timeout_online'] >= $form['timeout_visit']) {
		mosRedirect('index2.php?option=com_forum&amp;task=options', _Y_NO_TIMEOUT);
	}
	while (list($key, $input) = @each($form)) {
		// Only update values that have changed
		if (array_key_exists('o_' . $key, $yarbb_config) && $yarbb_config['o_' . $key] != $input) {
			if ($input != '' || is_int($input)) {
				$value = '\'' . $database->getEscaped($input) . '\'';
			} else {
				$value = 'NULL';
			}
			$sql = ('UPDATE #__forum_config SET conf_value=' . $value . '
						WHERE conf_name=\'o_' . $database->getEscaped($key) . '\'');
			$database->setQuery($sql);
			$database->Query($sql);
		}
	}
	//Обновить разрешения PMS для групп
	while (list($id, $set) = @each($allow)) {
		$sql = ('UPDATE #__forum_groups SET g_pm=' . $set . ' WHERE g_id=\'' . $id . '\'');
		$database->setQuery($sql);
		$database->Query($sql);
	}
	while (list($id, $set) = @each($limit)) {
		$sql = ('UPDATE #__forum_groups SET g_pm_limit=' . intval($set) . 'WHERE g_id=\'' . $id . '\'');
		$database->setQuery($sql);
		$database->Query($sql);
	}
	require_once $yarbb_admin_path . '/include/cache.php';
	generate_config_cache();
	mosRedirect('index2.php?option=com_forum&amp;task=options', _CONFIGURATION_IS_UPDATED);
}